package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-06-03 10:03
 */
public class Test04 {
    public static void main(String[] args) {
        Student s1 = new Student("1","zs",11);
        Student s2 = new Student("1","zs",11);
        System.out.println(s1==s2);
        //equals是Object的方法，默认使用==比较地址
        System.out.println(s1.equals(s2));
        System.out.println(s1.equals(new Cat("cat1",11,100)));

        System.out.println("---------------");
        Teacher t1 = new Teacher("1","zs",11);
        Teacher t2 = new Teacher("2","zxs",11);
        System.out.println(t1.equals(t2));
    }
}
